home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / pdcurs21 / portable / prefresh.c < prev    next >
C/C++ Source or Header  |  1993-06-18  |  3KB  |  78 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3. #undef    prefresh
  4.  
  5. #ifdef PDCDEBUG
  6. char *rcsid_prefresh = "$Header: C:\CURSES\portable\RCS\prefresh.c 2.1 1993/06/18 20:20:46 MH Rel MH $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   prefresh()    - refresh pad
  15.  
  16.   X/Open Description:
  17.      The prefresh routine copies the specified pad to the physical
  18.      terminal screen.  It takes account of what is already
  19.      displayed on the screen to optimize cursor movement.
  20.  
  21.      The pnoutrefresh routine copies the named pad to the virtual
  22.      screen. It then compares the virtual screen with the physical
  23.      screen and performs the actual update.
  24.  
  25.      These routines are analogous to the routines wrefresh and
  26.      wnoutrefresh except that pads, instead of windows, are
  27.      involved.  Additional parameters are also needed to indicate
  28.      what part of the pad and screen are involved. The upper left
  29.      corner of the part of the pad to be displayed is specified by
  30.      py and px.  The coordinates sy1, sx1, sy2, and sx2 specify the
  31.      edges of the screen rectangle that will contain the selected
  32.      part of the pad.
  33.  
  34.      The lower right corner of the pad rectangle to be displayed is
  35.      calculated from the screen co-ordinates.  This ensures that
  36.      the screen rectangle and the pad rectangle are the same size.
  37.  
  38.      Both rectangles must be entirely contained within their
  39.      respective structures.
  40.  
  41.   PDCurses Description:
  42.      Contrary to the statements above, the pnoutrefresh() routine
  43.      will not perform an update to the physical screen.  This task
  44.      is performed by doupdate().
  45.  
  46.   X/Open Return Value:
  47.      The prefresh() function returns OK on success and ERR on error.
  48.  
  49.   PDCurses Errors:
  50.      It is an error to pass a null WINDOW* pointer.
  51.  
  52.   Portability:
  53.      PDCurses    int prefresh( WINDOW* win, int py, int px,
  54.                          int sy1, int sx1,
  55.                          int sy2, int sx2 );
  56.      X/Open Dec '88    int prefresh( WINDOW* win, int py, int px,
  57.                          int sy1, int sx1,
  58.                          int sy2, int sx2 );
  59.      SYS V Curses    int prefresh( WINDOW* win, int py, int px,
  60.                          int sy1, int sx1,
  61.                          int sy2, int sx2 );
  62.  
  63. **man-end**********************************************************************/
  64.  
  65. int    prefresh(WINDOW* win,int py,int px,int sy1,int sx1,int sy2,int sx2)
  66. {
  67. #ifdef PDCDEBUG
  68.     if (trace_on) PDC_debug("prefresh() - called\n");
  69. #endif
  70.  
  71.     if (win == (WINDOW *)NULL)
  72.         return( ERR );
  73.  
  74.     pnoutrefresh(win, py, px, sy1, sx1, sy2, sx2);
  75.     doupdate();
  76.     return( OK );
  77. }
  78.